// https://vike.dev/data
/* 服务端获取数据 */
export { data }
export type Data = Awaited<ReturnType<typeof data>>

import type { PageContextServer } from 'vike/types'

const data = async (pageContext: PageContextServer) => {
  console.log('data', pageContext)
  // 获取路由参数
  const { name } = pageContext.routeParams

  /* 如果需要抛出错误或者跳转页面可以直接 */
  /* throw redirect('/movie/add') */
  // throw render('/movie/add') throw render('/movie/add', { name: 'hello' })
  const description='description-My Vike + Vue + Pinia App'
  return { name,description }
}
